package com.trade.service.impl;

import java.util.List;

import com.trade.dao.ISupplierDao;
import com.trade.exception.BusinessException;
import com.trade.exception.PersistenceException;
import com.trade.model.Supplier;
import com.trade.service.ISupplierSevice;

/**
 * @author Lin Yang
 * 
 */
public class SupplierSeviceImpl implements ISupplierSevice {
    private ISupplierDao supplierDao;

    @Override
    public List<Supplier> findAllLike(String name) throws BusinessException {
        try {
            return supplierDao.findAllLike(name);
        } catch (PersistenceException e) {
            throw new BusinessException("查询供应商档案失败", e);
        }
    }

    public void setSupplierDao(ISupplierDao supplierDao) {
        this.supplierDao = supplierDao;
    }

}
